package com.fy.fyspace.model.enums.file;



public enum FileFolderTypeEnums {
    FILE(0, "文件"),
    FOLDER(1, "目录");

    private Integer type;
    private String desc;

    FileFolderTypeEnums(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    //写一个通过type获取desc的方法
    public static FileFolderTypeEnums getByType(Integer type) {
        for (FileFolderTypeEnums item : FileFolderTypeEnums.values()) {
            if (item.getType().equals(type)) {
                return item;
            }
        }
        return null;
    }
}
